import type { Config } from 'drizzle-kit'
import * as dotenv from 'dotenv'

// Load environment variables from .env file
dotenv.config()

export default {
  schema: `./src/db/schema.ts`,
  out: `./src/db/migrations`,
  dialect: `postgresql`,
  dbCredentials: {
    host: process.env.DB_HOST || `localhost`,
    port: Number(process.env.DB_PORT) || 54321,
    user: process.env.DB_USER || `postgres`,
    password: process.env.DB_PASSWORD || `password`,
    database: process.env.DB_NAME || `electric`,
  },
} satisfies Config
